#!/usr/bin/python


import os
import sqlite3

transactions = """
CREATE TABLE transactions (
  revision INTEGER PRIMARY KEY AUTOINCREMENT,
  action VARCHAR,
  ref VARCHAR,
  sha1 VARCHAR unique,
  origin VARCHAR);
"""


def main():
    if not os.path.exists('svnserver'):
        os.mkdir('svnserver')

    conn = sqlite3.connect('svnserver/db', isolation_level='IMMEDIATE')

    # Create tables
    conn.execute(transactions)

    conn.commit()
    conn.close()


if __name__ == "__main__":
    main()
